package com.dfbz.demo_第七题;

import java.io.FileWriter;
import java.io.IOException;

/**
 * @author lscl
 * @version 1.0
 * @intro:
 */
public class Demo01_JDK7之前的异常处理方式 {
    public static void main(String[] args)  {

        FileWriter fw = null;
        try {
           fw  = new FileWriter("fw.txt");
            fw.write("我是中国人");
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            if (fw != null) {
                try {
                    fw.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}
